{include file="header.html"}

<div class="page-header">
	<h6>
		套餐管理
		<small>
			<i class="ace-icon fa fa-angle-double-right"></i>
			套餐明细
		</small>
		<div>
			<a href="?app=meal&act=export&where={$where}" target="_blank">导出到EXCEL</a>
		</div>		
	</h6>
</div>

<form class="form-inline" action="?" method="get">
<input type="hidden" name="app" id="app" value="meal" />
<input type="hidden" name="act" id="act" value="history" />
<input type="text" class="input-medium" placeholder="关键词" name="keyword" value="{$keyword}" /> 
<select name="meal_id" id="meal_id" class="form-control">
	<option value=""> 套餐 </option>
	{foreach from=$meals name=meal item=meal}
	<option value="{$meal->id}" {if $meal->id==$meal_id}selected{/if}>{$meal->name}</option>
	{/foreach}
</select>
<select name="type" id="type" class="form-control">
	<option value="">类型</option>
	<option value="0" {if $type==='0'}selected{/if}>使用</option>
	<option value="1" {if $type==='1'}selected{/if}>购买</option>
</select> 
<button type="submit" class="btn btn-info btn-sm">
	<i class="ace-icon fa fa-search bigger-110"></i>搜索
</button>
</form>

<div class="table-content">
<table id="simple-table" class="table table-striped table-bordered table-hover">
	<thead>
		<tr>
			<th>ID</th>
			<th>会员</th>
			<th>套餐</th>
			<!--<th>套餐金额</th>-->
			<th>关联订单</th>
			<th>操作时间</th>
			<th>类型</th>
		</tr>
	</thead>

	<tbody>
		{foreach from=$rs item=row name=row}
		<tr>
			<td>{$row.id}</td>
			<td><a href="?app=member&act=edit&id={$row.member_id}">{$row.member_name}({$row.mobile})</a></td>
			<td>{$row.meal_name}</td>
			<!--<td>￥{$row.meal_price}</td>-->
			<td><a href="?app=order&act=edit&id={$row.order_id}" target="_blank">{$row.order_sn}</a></td>
			<td>{$row.add_time|date_format:"%Y-%m-%d %H:%I:%S"}</td>
			<td>{if $row.type==0}使用{else}购买{/if}</td>
		</tr>
		{foreachelse}
		<tr bgcolor="white"><td colspan="13" height="50">暂无记录</td></tr>
		{/foreach}	
		
	</tbody>
</table>
</div>
<div class="mypage">
	共 {$page.num_records} 个记录  {$page.current_page} / {$page.num_pages} 页  {$page.first_page} {$page.prev} {$page.nav} {$page.next} {$page.last_page}
</div>
{include file="footer.html"}
